package com.itheima.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.mapper.EmployeeMapper;
import com.itheima.pojo.Employee;

import com.itheima.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public void insert(Employee employee) {
        employeeMapper.insert(employee);
    }


    @Override
    public Employee selectById(Long id) {
        return employeeMapper.selectById(id);
    }

    @Override
    public void update(Employee employee) {
        employeeMapper.updateById(employee);
    }


    @Override
    public Page page(Page employeePage, LambdaQueryWrapper<Employee> lqw) {
        return employeeMapper.selectPage(employeePage, lqw);
    }

    @Override
    public Employee selectOne(LambdaQueryWrapper<Employee> lqw) {
        return employeeMapper.selectOne(lqw);
    }


}
